<template>
  <view class="pageMain">
    <view class="listMain">
      <view class="listItem" v-for="(item, index) in problemList" :key="index">
        <view class="header">
          {{item.title}}
        </view>
        <view class="body">
          <view class="answerItem">
            <u-radio-group v-model="answerValue" :wrap="item.type === 'judgment'">
              <u-radio
                  v-for="(it, i) in item.answerList" :key="i"
                  :name="it.answer"
              >
                {{it.answer}}
              </u-radio>
            </u-radio-group>
          </view>
        </view>
      </view>
      <view class="btnBox">
        <u-button type="primary">提交</u-button>
      </view>
    </view>
    <u-back-top :scroll-top="scrollTop"></u-back-top>
    <u-top-tips ref="uTips"></u-top-tips>
    <toast></toast>
  </view>
</template>
<script>
export default {
  data() {
    return {
      scrollTop: 0,
      answerValue: '',
      problemList: [
        {
          title: '1.您对课程内容的满意度如何？（单选）',
          type: 'radio',
          answer: '',
          answerList: [{
            answer: '非常满意'
          }, {
            answer: '满意'
          }, {
            answer: '一般'
          }, {
            answer: '不太满意'
          }, {
            answer: '非常不满意'
          }]
        },
        {
          title: '2.您对授课老师的满意度如何？（单选）',
          type: 'radio',
          answer: '',
          answerList: [{
            answer: '非常满意'
          }, {
            answer: '满意'
          }, {
            answer: '一般'
          }, {
            answer: '不太满意'
          }, {
            answer: '非常不满意'
          }]
        },
        {
          title: '3.培训机构的课程安排合理，能够满足我的学习需求？（判断）',
          type: 'judgment',
          answer: '',
          answerList: [{
            answer: '是'
          }, {
            answer: '否'
          }]
        }
      ],
    }
  },
  onLoad() {},
  onShow() {},
  onPullDownRefresh() {},
  onShareAppMessage() {},
  methods: {
    /* 顶部提示文字 */
    uTips(title, type = 'warning', duration = 1500) {
      this.$refs.uTips.show({
        title: title,
        type: type,
        duration: duration,
      })
    },
    /* 返回顶部 */
    onPageScroll(e) {
      this.scrollTop = e.scrollTop
    },
  },
}
</script>
<style lang="scss" scoped>
page {
  background: #fff;
  padding-bottom: 120rpx;
}
.pageMain{
}
.listMain{
  padding: 20rpx;
}
.listItem{
  padding: 20rpx;
  background: #f1f1f1;
  margin-bottom: 15rpx;
  border-radius: 16rpx;
  .header{
    padding: 10rpx 0 20rpx;
    border-bottom: 1rpx solid #e1e1e1;
    line-height: 40rpx;
    font-size: 32rpx;
  }
  .body{
    padding-top: 20rpx;
  }
}
</style>
